package org.example;

public class 第二十三章_多态 {
    public static void main(String[] args) {
        Animal animal = new Cat();
        Animal animal1 = new Dog();

        animal.eat();
        animal1.eat();
    }

}

abstract class Animal {
    abstract void eat();
}

class Cat extends Animal{
    @Override
    void eat() {
        System.out.println("正在吃鱼");
    }
}

class Dog extends Animal{
    @Override
    void eat() {
        System.out.println("正在吃骨头");
    }
}